

# Introduction ------------------------------------------------------------
# Donald Casler and Dylan Groves
# Perspective Take Through Partisan Eyes
# Contact: dylanwgroves@gmail.com


# Figure 1: Dispositional Empathy and Support for Cooperation -------------


# Load Files
library(BayesTree)
library(data.table)
library(dismo)
library(dplyr)
library(estimatr)
library(FindIt)
library(ggplot2)
library(ggpubr)
library(grf)
library(plotrix)
library(rgeos)
library(rgdal)
library(readstata13)
library(RColorBrewer)
library(sf)
library(sp)
library(tidyverse)
library(tree)
library(grid)
library(magrittr)
library(quanteda)
library(stm)

# Clear -------------------------------------------------------------------
rm(list = ls(all = TRUE))


# Load Data ---------------------------------------------------------------
#setwd("C:/Users/dylan/Dropbox/Paper - PTinIR")
master <- read.dta13("~/Dropbox/Columbia/Paper - PTinIR/09 Code/07_Replication/ptinir_pooled.dta")
master <- master[!is.na(master$treat_pt),] # keep only observed values in treatment
master <- master[!is.na(master$c_pid_long),] # drop incomplete PID responses
master$dv <- master$dv_coop
master$age <- as.factor(master$c_age)

# Set up log file

sink("ptinir_replication_figures_log.txt")

# Set Parameters ----------------------------------------------------------

# Set Dodge
dodge_width <- 0.0
dodge <- position_dodge(width = dodge_width)

# Set Jitter
jitter_width <- 0.4
jitter_height <- 0.4

# Set size of plot
dot_size <- 4

# Set darkness
alpha = 0.5

# Set y minimum
min = 0

# Set stroke
stroke = 1.7



# Reshape Long ------------------------------------------------------------

# Note: only the Wave 1 and 3 data contain the dispositional measures plotted 
# in Figure 1 and Figure A13

# Master
df.long <- master[master$wave==1,]
#df.long <- master[master$wave==3,] # use if replicating Figure A13

df.long$pt1 <- df.long$c_pt_index
df.long$pt2 <- df.long$c_ce_index 
df.long$pt3 <- df.long$c_ee_index 

df.long <- df.long %>% 
  dplyr::select(u_id, dv_coop, c_pt_index, c_ce_index, c_ee_index)

df.long <- df.long %>% pivot_longer(cols = starts_with("c"), names_to = "pt_type", values_to = "pt_value")

df.empathy <- df.long %>%
  filter(pt_type == 'c_pt_index')

# Long Outcome ------------------------------------------------------------

df.long$pt_type_factor <- factor(df.long$pt_type)
cols <- c("c_ce_index" = "twodash", "c_ee_index" = "dotted", "c_pt_index" = "solid")

lm_pt <- lm_robust(dv_coop ~ pt_value, data = df.long[df.long$pt_type == "c_pt_index",])
lm_ee <- lm_robust(dv_coop ~ pt_value, data = df.long[df.long$pt_type == "c_ee_index",])
lm_ce <- lm_robust(dv_coop ~ pt_value, data = df.long[df.long$pt_type == "c_ce_index",])

# For Figure 1
summary(lm_pt) # 0.34, p < 0.001
summary(lm_ee) # 0.32, p < 0.001
summary(lm_ce) # 0.16, p < 0.05

all <- grobTree(textGrob(paste0("All Empathy: coef = 0.34, p < 0.001"), x=0.05,  y=0.95, hjust=0,
                         gp=gpar(fontsize=10, fontface="bold")))
ee <- grobTree(textGrob(paste0("Emotional Empathy: coef = 0.32, p < 0.001"), x=0.05,  y=0.88, hjust=0,
                        gp=gpar(fontsize=10, fontface="italic")))
ce <- grobTree(textGrob(paste0("Cognitive Empathy: coef = 0.16, p < 0.05"), x=0.05,  y=0.83, hjust=0,
                        gp=gpar(fontsize=10, fontface="italic")))

# For Figure A13

summary(lm_pt) # 0.41, p < 0.001
summary(lm_ee) # 0.31, p < 0.001
summary(lm_ce) # 0.24, p < 0.05

all <- grobTree(textGrob(paste0("All Empathy: coef = 0.41, p < 0.001"), x=0.05,  y=0.95, hjust=0,
                         gp=gpar(fontsize=10, fontface="bold")))
ee <- grobTree(textGrob(paste0("Emotional Empathy: coef = 0.31, p < 0.001"), x=0.05,  y=0.88, hjust=0,
                        gp=gpar(fontsize=10, fontface="italic")))
ce <- grobTree(textGrob(paste0("Cognitive Empathy: coef = 0.24, p < 0.05"), x=0.05,  y=0.83, hjust=0,
                        gp=gpar(fontsize=10, fontface="italic")))

plot_disp_pt <-
  ggplot(df.long, 
         aes(x = pt_value, y = dv_coop)) +
  geom_jitter(size = 0.3, alpha = 0.85, colour = "grey") +
  geom_smooth(method = lm,
              se = FALSE,
              colour = "black",
              aes(linetype = pt_type_factor)) +
  geom_smooth(data = df.empathy,
              method = lm, se = TRUE,
              colour = "black") + 
  scale_linetype_manual(values = cols,
                        labels = c("Cognitive Empathy", "Emotional Empathy", "Empathy")) +
  theme_bw() +
  scale_x_continuous(name="Perspective Taking Index") +
  scale_y_continuous("Support for Int'l Cooperation") +
  theme(legend.position="top",
        legend.title = element_blank(),
        legend.text=element_text(size=12),
        axis.title.x = element_text(size = 18),
        axis.title.y = element_text(size = 18),
        axis.text.x=element_text(size=rel(2)),
        axis.text.y=element_text(size=rel(2))) +
  annotation_custom(all) +
  annotation_custom(ee) +
  annotation_custom(ce)

plot_disp_pt
  

# Figure 2: Effect of Perspective-Taking Cues by Strength of Party Identification -----

# Generate Data -----------------------------------------------------------

mean <- mean(master$c_pt_index, na.rm = T)

master$t_des_dum <- ifelse(master$c_pt_index > median(master$c_pt_index, na.rm = TRUE), "Treat", "Control")
master$t_exp <- ifelse(master$treat_pt == 1, "Treat", "Control")
master$age <- as.factor(master$c_age)

# Set Parameters ----------------------------------------------------------

# Set Dodge
dodge_width <- 0.0
dodge <- position_dodge(width = dodge_width)

# Set Jitter
jitter_width <- 0.4
jitter_height <- 0.4

# Set size of plot
dot_size <- 4

# Set darkness
alpha = 0.5

# Set y minimum
min = 0

# Set stroke
stroke = 1.7

# Prepare for Long --------------------------------------------------------
master$c_pid_long_rev <- as.numeric(dplyr::recode(as.character(master$c_pid_long), "1" = "5", "2" = "4", "3" = "3", "4" = "2", "5" = "1", "NA" = "NA"))

name_list <-      c("Strong Democrat",
                    "Democrat",
                    "Independent",
                    "Republican",
                    "Strong Republcian")


# Set Variables -----------------------------------------------------------
master$cov <- master$c_pid_long_rev
master$dv <- master$dv_coop
master$treat <- master$t_exp


# Filter ------------------------------------------------------------------
df <- master[!is.na(master$cov) & !is.na(master$dv) & !is.na(master$treat),]

# Create Lists
plot_list = list()
coef_list = list()
pval_list = list()



# Run Loop ----------------------------------------------------------------
for (i in 1:5) {
  
  df_loop <- df[df$cov == i,]
  
  
  # Run Regression ----------------------------------------------------------
  
  
  lm_fit <- lm(dv ~ as.factor(treat), data = df_loop)
  lm_fit_store <- tidy(lm_fit)
  
  ## Store Coefficient
  
  coef_list[[i]] <- round(lm_fit_store[2,2], 2)
  pval_list[[i]] <- round(lm_fit_store[2,5], 3)
  
  
  
  # Create Summary Table ----------------------------------------------------
  summary_list <-
    df_loop %>%
    group_by(treat) %>%
    do(tidy(lm_robust(dv ~ 1, data = .))) %>%
    mutate(dv = estimate)
  
  
  
  # Generate Plot -----------------------------------------------
  plot <- 
    ggplot(summary_list, aes(group = 1, y = dv, x=as.factor(treat)),
           width = 0.5) +
    geom_jitter(data = df, size = 0.3, alpha = 0.85, colour = "grey", 
                aes(group = treat, y = dv_coop, x = as.factor(treat))) +
    geom_point(stroke = stroke, size = 0.8, position = dodge) +
    geom_errorbar(aes(ymin = estimate-std.error, ymax = estimate+std.error),
                  width = 0.02,
                  position = dodge) +
    geom_line() +
    coord_cartesian(ylim = c(1, 5)) +
    theme_bw() +
    theme(legend.position = "",
          axis.text.y=element_blank(),
          axis.ticks.y=element_blank(),
          axis.title.x = element_text(size = 18),
          axis.text.x=element_text(size=rel(2))) +
    xlab(name_list[[i]]) +
    ylab("")
  plot_list[[i]] = plot
}

# Make Plot and Save ------------------------------------------------------

# Set tic marks for GOP
plot_list[[1]] <- plot_list[[1]] + theme(axis.text.y=element_text(size=rel(2)),
                                         axis.title.y=element_text(size = 25))

# Add coefficients and p-values from Appendix Table K11: "Results by Strength of Party Identification"
plot_list[[1]] <- plot_list[[1]] + annotate("text", x = c(1.5), y=4.5, size = 6, label = paste0("b = -0.10, p = 0.874"))
plot_list[[2]] <- plot_list[[2]] + annotate("text", x = c(1.5), y=4.5, size = 6, label = paste0("b = 0.05, p = 0.257"))
plot_list[[3]] <- plot_list[[3]] + annotate("text", x = c(1.5), y=4.5, size = 6, label = paste0("b = 0.21, p = 0.004"))
plot_list[[4]] <- plot_list[[4]] + annotate("text", x = c(1.5), y=4.5, size = 6, label = paste0("b = 0.24, p = 0.011"))
plot_list[[5]] <- plot_list[[5]] + annotate("text", x = c(1.5), y=4.5, size = 6, label = paste0("b = 0.04, p = 0.346"))

plot_exp <- ggarrange(plotlist = plot_list,
                      ncol = 5, nrow = 1)

plot_combined_pidlong <- annotate_figure(plot_exp,
                                         bottom = text_grob("Estimated Treatment Effects (Non-Bootstrapped)", color = "black",
                                                            hjust = 1, x = 1, face = "italic", size = 10),
                                         left = text_grob("Support for Int'l Cooperation - Strength of Party Identification", color = "black", rot = 90))

plot_combined_pidlong

# Figure A20: Topic Model Diagnostics ----------------------------------------------------

# NOTE TO REPLICATION ANALYST ------------------------------------------------------------

# The topic modeling results produced here differ slightly from those in the previously 
# submitted Appendix 16 due to an oversight on our part related to setting a seed. We plan
# to update the relevant figures, tables, and brief discussion for the final files. Please
# feel free to contact us with any questions! We will remove this note prior to publication.

# Remove Wave 3 data

master <- master[master$wave!=3,] # Wave 3 did not contain qualitative responses

# Remove poor quality responses based on manual review of raw data -----------------------

master <- master[master$dv_qual_omit!=1,]

# Create dummy for independents

master$inds <- ifelse(master$c_pid==2,1,0)

# Create separate dataframes for treatment and control, then preprocess text data --------

# Climate
t_climate <- master[master$treat_pt==1&master$treat_t==0,]
c_climate <- master[master$treat_pt==0&master$treat_t==0,]

c_processed <- textProcessor(c_climate$dv_qual, metadata = c_climate)
c_out <- prepDocuments(c_processed$documents, c_processed$vocab, c_processed$meta)

t_processed <- textProcessor(t_climate$dv_qual, metadata = t_climate)
t_out <- prepDocuments(t_processed$documents, t_processed$vocab, t_processed$meta)

# Nukes
t_nukes <- master[master$treat_pt==1&master$treat_t==1,]
c_nukes <- master[master$treat_pt==0&master$treat_t==1,]

nc_processed <- textProcessor(c_nukes$dv_qual, metadata = c_nukes)
nc_out <- prepDocuments(nc_processed$documents, nc_processed$vocab, nc_processed$meta)

nt_processed <- textProcessor(t_nukes$dv_qual, metadata = t_nukes)
nt_out <- prepDocuments(nt_processed$documents, nt_processed$vocab, nt_processed$meta)

# Find number of topics

set.seed(1234)
searchKc <- searchK(c_out$documents, c_out$vocab, K = 4:14, data = c_out$meta, verbose = F)
plot(searchKc) # Use subcorpus with smallest number of documents

# Figure A14: Changes in Topic Prevalance; Climate Vignette --------------------------
# Code for Figures A15-16 also included in this section

# Control ----------------------------------------------------------------------------
c_climate.model <- selectModel(c_out$documents, c_out$vocab, K=6, 
                               prevalence = ~ inds, max.em.its = 300,
                               runs=20, data = c_out$meta, seed = 1234, verbose = F)
plotModels(c_climate.model) # model 1 looks best
c_climate.model1 <- c_climate.model$runout[[1]] # select model 1
labelTopics(c_climate.model1) # display most common words for labeling

c_climate.model1.effect <-  estimateEffect(1:6 ~ inds, c_climate.model1, meta=c_out$meta, uncertainty = "Global")
summary(c_climate.model1.effect) # see which topics are significant

plot(c_climate.model1.effect, covariate = "inds", 
     topics = c(3,4), 
     method = "difference", 
     cov.value1=1, cov.value2=0, xlab = "Change in topical prevalence from Partisan to Independent", main = "Partisans vs. Independents; Climate Control", xlim = c(-.1,.1), 
     labeltype = "custom", custom.labels = c("U.S. Leadership","Reduce Emissions")
) # Figure A14 (top panel)

plot(c_climate.model1, type = "labels") # Figure A15

# PT Treatment ----------------------------------------------------------------------
t_climate.model <- selectModel(t_out$documents, t_out$vocab, K=6, 
                               prevalence = ~ inds, max.em.its = 300,
                               runs=20, data = t_out$meta, seed = 1234, verbose = F)
plotModels(t_climate.model) # model 3 looks best
t_climate.model1 <- t_climate.model$runout[[3]] # select model 3
labelTopics(t_climate.model1) # display most common words for labeling

t_climate.model1.effect <-  estimateEffect(1:6 ~ inds, t_climate.model1, meta=t_out$meta, uncertainty = "Global")
summary(t_climate.model1.effect) # see which topics are significant

plot(t_climate.model1.effect, covariate = "inds", 
     topics = c(1,2,6), 
     method = "difference", 
     cov.value1=1, cov.value2=0, xlab = "Change in topical prevalence from Partisan to Independent", main = "Partisans vs. Independents; Climate PT", xlim = c(-.1,.1),
     labeltype = "custom", custom.labels = c('Economic Costs','U.S. Leadership',"Others' Behavior")
) # Figure A14 (bottom panel)

plot(t_climate.model1, type = "labels") # Figure A16

# Example responses in Table A18 -----------------------------------------------------

# Control, Topic 3 = U.S. Leadership

c_climate3 <- findThoughts(c_climate.model1, texts=c_out$meta$dv_qual, topics=3, n=10) 

c_out$meta$dv_qual[576]
# "We need to do what is right regardless what other nations do. It is important for us to set an example of what we should do to protect the environment."
c_out$meta$dv_qual[489]
# "This isn't a localized issue, it's a issue impacting the whole world.  The US needs to act regardless of who or what other country is doing it.  Take the lead and show other countries what needs to be done."
c_out$meta$dv_qual[454]
# "We need to do something and be a leader in environmental policies.  We need to do everything we can to get other countries on board but we must lead by example as well."
c_out$meta$dv_qual[548]
# "The US needs to be an example to the rest of the world."
c_out$meta$dv_qual[487]
# "The US is the most powerful country in the world in terms of military, economy, and influence. Offsetting carbon emissions is an issue that all countries need to tackle, but regardless what other countries do, the US still needs to strive to set the best example on a global scale and sign this sort of treaty. The rest of the G7 need to hold themselves accountable for their emissions as well, and seeing that the US takes the forefront in this sort of issue, the rest of the G7 would be more likely to sign a treaty. "

# Control, Topic 4 = Reduce Emissions

c_climate4 <- findThoughts(c_climate.model1, texts=c_out$meta$dv_qual, topics=4, n=10) 

c_out$meta$dv_qual[565]
# "I want the future for the next generation to have atleast the quality of life I have now. Climate change could effect that hope."
c_out$meta$dv_qual[561]
# "I thought of how climate change is affecting the US and the world in general. I thought about the future generations and what they have to deal with due to climate change."
c_out$meta$dv_qual[502]
# "We should have been doing this 40 years ago. We should have gradually moved  away from fossil fuels. We are looking at a climate change cataclysm at this point. Mass migration out of arid regions alone will completely destabilize countries because, when push comes to shove, we are too god damn racist and xenophobic to deal with an influx of nonwhite people in western countries in the northern hemisphere. There will be water shortages and crop failures. There will be extreme measures taken by governments. Crimes against humanity, economic austerity. Ecological collapse. Anything to mitigate what is coming should be on the table. Globally, governments/corporation should be spending trillions annually to prepare for the worst. But we wont because humanity is pure [sic] shit. "
c_out$meta$dv_qual[389]
# "Climate change is very serious and strict measures should be taken to fix it."
c_out$meta$dv_qual[85]
# "the pressing current effects now of climate change"

# PT Treatment, Topic 1 = Economic Costs

t_climate1 <- findThoughts(t_climate.model1, texts=t_out$meta$dv_qual, topics=1, n=10) 

t_out$meta$dv_qual[907]
# "We already pay enough taxes. Taxing the citizens for use of much needed energy would be more of a burden on the middle and lower class."
t_out$meta$dv_qual[768]
# "Alot of Americans already have trouble paying their energy bills. Taxing these would out more strain on these families."
t_out$meta$dv_qual[208]
# "Financial complications from extra taxes, causing high prices to consumers"
t_out$meta$dv_qual[1069]
# "What the end result is going to cost me. I'm already struggling enough to pay all of the bills, I certainly don't want to add more on top of it."
t_out$meta$dv_qual[322]
# "the tax increase effect, what it could do to financially struggling people "

# PT Treatment, Topic 2 = U.S. Leadership

t_climate2 <- findThoughts(t_climate.model1, texts=t_out$meta$dv_qual, topics=2, n=10) 

t_out$meta$dv_qual[1022]
# "its for the greater good, it is a problem the entire world is facing. it is the right thing to do"
t_out$meta$dv_qual[1016]
# "Basically just what's best for the world is whats best for the US. Most other countries cant have the same impact as us. "
t_out$meta$dv_qual[1036]
# "I thought about how all countries share the same atmosphere, so we're all obligated to do our fair share. The US produces a lot of carbon dioxide, so we should be doing what we can to limit it. If we do it, then that could encourage other countries to do the same, as we are one of the leading powers on the globe."
t_out$meta$dv_qual[928]
# "That it's the right thing to do for the world at large, which has become an American perspective over the last hundred years or so."
t_out$meta$dv_qual[219]
# "yes i [sic] accep that because is the right thing to do and the best for the country too"

# PT Treatment, Topic 6 = Others' Behavior

t_climate6 <- findThoughts(t_climate.model1, texts=t_out$meta$dv_qual, topics=6, n=10) 

t_out$meta$dv_qual[269]
# "the other countries will not follow through with it and the usa would foot the whole bill."
t_out$meta$dv_qual[94]
# "Signing a treaty does not necessary mean that that country will try to get stronger on pollutions problems.  Some kind of actions should be done but unless ALL Countries agree to help then it will not be that effective. "
t_out$meta$dv_qual[933]
# "Each country should take upon itself to incorporate ways to reduce greenhouse gas emissions.  In seeking ways to do this, it should lead to innovation of new energy forms and resources."
t_out$meta$dv_qual[906]
# "The US needs to reduce emission regards of what other countries do. Chances are the other countries will just lie anyway."
t_out$meta$dv_qual[980]
# "If the US is doing this alone while other countries are polluting the world, what the US does will be offset by other countries. Then the effort is just plain useless. Climate change is a global effort.  "

# Figure A17: Changes in Topical Prevalence; Nuclear Vignette -------------------------
# Code for Figures A18-19 also included in this section

# Control ----------------------------------------------------------------------------
?selectModel
c_nukes.model <- selectModel(nc_out$documents, nc_out$vocab, K=6, 
                             prevalence = ~ inds, max.em.its = 300,
                             runs=20, data = nc_out$meta, seed = 1234, verbose = F)
plotModels(c_nukes.model) # model 2 looks best
c_nukes.model1 <- c_nukes.model$runout[[2]] # select model 1
labelTopics(c_nukes.model1) # display most common words for labeling

c_nukes.model1.effect <-  estimateEffect(1:6 ~ inds, c_nukes.model1, meta=nc_out$meta, uncertainty = "Global")
summary(c_nukes.model1.effect) # see which topics are significant

plot(c_nukes.model1.effect, covariate = "inds", 
     topics = c(5), 
     method = "difference", 
     cov.value1=1, cov.value2=0, xlab = "Change in topical prevalence from Partisan to Independent", main = "Partisans vs. Independents; Nukes Control", xlim = c(-.1,.1),
     labeltype = "custom", custom.labels = c("Others' Behavior")
) # Figure A17 (top panel)

plot(c_nukes.model1, type = "labels") # Figure A18

# PT Treatment ----------------------------------------------------------------------

t_nukes.model <- selectModel(nt_out$documents, nt_out$vocab, K=6, 
                             prevalence = ~ inds, max.em.its = 300,
                             runs=20, data = nt_out$meta, seed = 1234, verbose = F)
plotModels(t_nukes.model) # model 2 is best
t_nukes.model1 <- t_nukes.model$runout[[2]] # select model 2
labelTopics(t_nukes.model1) # display most common words for labeling

t_nukes.model1.effect <-  estimateEffect(1:6 ~ inds, t_nukes.model1, meta=nt_out$meta, uncertainty = "Global")
summary(t_nukes.model1.effect) # see which topics are significant

plot(t_nukes.model1.effect, covariate = "inds", 
     topics = c(1,4), 
     method = "difference", 
     cov.value1=1, cov.value2=0, xlab = "Change in topical prevalence from Partisan to Independents", main = "Partisans vs. Independents; Nukes PT", xlim = c(-.1,.1), 
     labeltype = "custom", custom.labels = c('Nuclear Dangers',"Self-Defense")
) # Figure A17 (bottom panel)

plot(t_nukes.model1, type = "labels") # Figure A19

# Example responses in Table A19 -----------------------------------------------------

# Control, Topic 5 = Others' Behavior

c_nukes5 <- findThoughts(c_nukes.model1, texts = nc_out$meta$dv_qual, topics = 5, n = 10) 

nc_out$meta$dv_qual[372]
# "I was considering what kind of effect this treaty may even have with the signers not to mention those that abstained. I personally didn't think that this treaty would be enough to actually get people to stop and invest in other avenues of deterrent which to me makes me wonder if it's all worth it or not."
nc_out$meta$dv_qual[109]
# "In my opinion unless there is a governing entity that can check and verify this and all countries agree and hold to the agreement then it would open the US up to attack from anyone that didn't adhere to the agreement."
nc_out$meta$dv_qual[311]
# "we would get weaker while everyone gets stronger"
nc_out$meta$dv_qual[593]
# "I thought about the high risk that nuclear weapons carry because maybe a moment of impulse or panic could be used improperly"
nc_out$meta$dv_qual[553]
# "Nuclear weapons are a deterrent that stops other nations from just teaming up and taking over the USA, for example. It's a very effective deterrent. We should keep ours and agree to stop developing only if all others stop as well."

# PT Treatment, Topic 1 = Nuclear Dangers

t_nukes1 <- findThoughts(t_nukes.model1, texts = nt_out$meta$dv_qual, topics = 1, n = 10) 

nt_out$meta$dv_qual[176]
# "You have to take into considerations of the Death toll, that it might bring, not to mention destroying the US"
nt_out$meta$dv_qual[109]
# "Nuclear weapons are unnecessary and create a worse form of warfare. Warfare escalates in violence with the escalation of weaponry. At the rate of development eventually someone will blow the entire world up"
nt_out$meta$dv_qual[1033]
# "Primarily the current inventory of nuclear weapons already deployed. Why build more when the current inventory could already destroy the entire planet. Somebody has to lead here and the U.S. could do that."
nt_out$meta$dv_qual[661]
# "Nuclear weapons are a constant threat because all it takes is a bully with a big red button to annihilate us all."
nt_out$meta$dv_qual[696]
# "Nuclear weapons pose a great danger to those in the immediate area of development and manufacturing."

# PT Treatment, Topic 4 = Self-Defense

t_nukes4 <- findThoughts(t_nukes.model1, texts = nt_out$meta$dv_qual, topics = 4, n = 10) 

nt_out$meta$dv_qual[1152]
# "The United States is a very powerful country and is often looked upon by other countries to provide military defense in tense situations. Because of this, it is important that the U.S. is prepared to defend themselves against any scenario they may encounter among opposing countries. "
nt_out$meta$dv_qual[336]
# "I would like my country to have peace with other countries, however, I would also like my country to protect themselves in case of an immediate attack."
nt_out$meta$dv_qual[189]
# "We must have the power to protect our country"
nt_out$meta$dv_qual[1042]
# "The united states is the number one power military and cannot be caught off guard"
nt_out$meta$dv_qual[941]
# "If other countries do not stop we should not stop only to keep a balance of power. We cannot be viewed as weak, but we also cannot be viewed as bullies. We need to stay relevant. "

#sink()
